package com.jintian.smart.kernel.security.mapper;

import com.jintian.smart.base.api.security.entity.LoginFailEntity;
import com.jintian.smart.base.api.security.form.LoginFailQueryForm;
import com.jintian.smart.base.api.security.view.LoginFailVO;
import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import org.beetl.sql.core.page.PageResult;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.beetl.sql.mapper.annotation.Update;

/**
 * 登录失败
 */
@Mapper
@SqlResource("security.LoginFail")
public interface LoginFailMapper extends IBaseExtMapper<LoginFailEntity> {
    /**
     * 根据用户id和类型查询
     *
     * @param userId
     * @param userType
     * @return
     */
    LoginFailEntity selectByUserIdAndUserType(@Param("userId") Long userId, @Param("userType") Integer userType);

    /**
     * 根据用户id和类型查询 进行删除
     *
     * @param userId
     * @param userType
     * @return
     */
    @Update
    void deleteByUserIdAndUserType(@Param("userId") Long userId, @Param("userType") Integer userType);

    /**
     * 分页 查询
     *
     * @param queryForm
     * @return
     */
    PageResult<LoginFailVO> queryPage(@Param("queryForm") LoginFailQueryForm queryForm);
}
